Optimal. Leaf size=108 \[ \frac {3}{8} \left (a^2+b^2\right )^2 x-\frac {3 \left (a^2+b^2\right ) (b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{8 d}-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3152, 8}
\begin {gather*} -\frac {3 \left (a^2+b^2\right ) (b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{8 d}+\frac {3}{8} x \left (a^2+b^2\right )^2-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3152
Rubi steps
\begin {align*} \int (a \cos (c+d x)+b \sin (c+d x))^4 \, dx &=-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d}+\frac {1}{4} \left (3 \left (a^2+b^2\right )\right ) \int (a \cos (c+d x)+b \sin (c+d x))^2 \, dx\\ &=-\frac {3 \left (a^2+b^2\right ) (b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{8 d}-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d}+\frac {1}{8} \left (3 \left (a^2+b^2\right )^2\right ) \int 1 \, dx\\ &=\frac {3}{8} \left (a^2+b^2\right )^2 x-\frac {3 \left (a^2+b^2\right ) (b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{8 d}-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.41, size = 107, normalized size = 0.99 \begin {gather*} \frac {12 \left (a^2+b^2\right )^2 (c+d x)-16 a b \left (a^2+b^2\right ) \cos (2 (c+d x))-4 a b \left (a^2-b^2\right ) \cos (4 (c+d x))+8 \left (a^4-b^4\right ) \sin (2 (c+d x))+\left (a^4-6 a^2 b^2+b^4\right ) \sin (4 (c+d x))}{32 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.18, size = 153, normalized size = 1.42
method | result | size |
derivativedivides | \(\frac {b^{4} \left (-\frac {\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+a \,b^{3} \left (\sin ^{4}\left (d x +c \right )\right )+6 a^{2} b^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )-a^{3} b \left (\cos ^{4}\left (d x +c \right )\right )+a^{4} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) | \(153\) |
default | \(\frac {b^{4} \left (-\frac {\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+a \,b^{3} \left (\sin ^{4}\left (d x +c \right )\right )+6 a^{2} b^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )-a^{3} b \left (\cos ^{4}\left (d x +c \right )\right )+a^{4} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}\) | \(153\) |
risch | \(\frac {3 a^{4} x}{8}+\frac {3 a^{2} b^{2} x}{4}+\frac {3 b^{4} x}{8}-\frac {a^{3} b \cos \left (4 d x +4 c \right )}{8 d}+\frac {a \,b^{3} \cos \left (4 d x +4 c \right )}{8 d}+\frac {\sin \left (4 d x +4 c \right ) a^{4}}{32 d}-\frac {3 \sin \left (4 d x +4 c \right ) a^{2} b^{2}}{16 d}+\frac {\sin \left (4 d x +4 c \right ) b^{4}}{32 d}-\frac {a^{3} b \cos \left (2 d x +2 c \right )}{2 d}-\frac {a \,b^{3} \cos \left (2 d x +2 c \right )}{2 d}+\frac {a^{4} \sin \left (2 d x +2 c \right )}{4 d}-\frac {\sin \left (2 d x +2 c \right ) b^{4}}{4 d}\) | \(183\) |
norman | \(\frac {\left (\frac {3}{8} a^{4}+\frac {3}{4} a^{2} b^{2}+\frac {3}{8} b^{4}\right ) x +\left (\frac {3}{2} a^{4}+3 a^{2} b^{2}+\frac {3}{2} b^{4}\right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {3}{2} a^{4}+3 a^{2} b^{2}+\frac {3}{2} b^{4}\right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {3}{8} a^{4}+\frac {3}{4} a^{2} b^{2}+\frac {3}{8} b^{4}\right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {9}{4} a^{4}+\frac {9}{2} a^{2} b^{2}+\frac {9}{4} b^{4}\right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {16 a \,b^{3} \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {8 a^{3} b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {8 a^{3} b \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (3 a^{4}-42 a^{2} b^{2}+11 b^{4}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {\left (3 a^{4}-42 a^{2} b^{2}+11 b^{4}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {\left (5 a^{4}-6 a^{2} b^{2}-3 b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}-\frac {\left (5 a^{4}-6 a^{2} b^{2}-3 b^{4}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}\) | \(365\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 136, normalized size = 1.26 \begin {gather*} -\frac {a^{3} b \cos \left (d x + c\right )^{4}}{d} + \frac {a b^{3} \sin \left (d x + c\right )^{4}}{d} + \frac {{\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} a^{4}}{32 \, d} + \frac {3 \, {\left (4 \, d x + 4 \, c - \sin \left (4 \, d x + 4 \, c\right )\right )} a^{2} b^{2}}{16 \, d} + \frac {{\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) - 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} b^{4}}{32 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.33, size = 121, normalized size = 1.12 \begin {gather*} -\frac {16 \, a b^{3} \cos \left (d x + c\right )^{2} + 8 \, {\left (a^{3} b - a b^{3}\right )} \cos \left (d x + c\right )^{4} - 3 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d x - {\left (2 \, {\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{3} + {\left (3 \, a^{4} + 6 \, a^{2} b^{2} - 5 \, b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 381 vs.
\(2 (102) = 204\).
time = 0.21, size = 381, normalized size = 3.53 \begin {gather*} \begin {cases} \frac {3 a^{4} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 a^{4} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 a^{4} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 a^{4} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {5 a^{4} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} - \frac {a^{3} b \cos ^{4}{\left (c + d x \right )}}{d} + \frac {3 a^{2} b^{2} x \sin ^{4}{\left (c + d x \right )}}{4} + \frac {3 a^{2} b^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{2} + \frac {3 a^{2} b^{2} x \cos ^{4}{\left (c + d x \right )}}{4} + \frac {3 a^{2} b^{2} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{4 d} - \frac {3 a^{2} b^{2} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{4 d} + \frac {a b^{3} \sin ^{4}{\left (c + d x \right )}}{d} + \frac {3 b^{4} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 b^{4} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 b^{4} x \cos ^{4}{\left (c + d x \right )}}{8} - \frac {5 b^{4} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} - \frac {3 b^{4} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} & \text {for}\: d \neq 0 \\x \left (a \cos {\left (c \right )} + b \sin {\left (c \right )}\right )^{4} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.45, size = 122, normalized size = 1.13 \begin {gather*} \frac {3}{8} \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} x - \frac {{\left (a^{3} b - a b^{3}\right )} \cos \left (4 \, d x + 4 \, c\right )}{8 \, d} - \frac {{\left (a^{3} b + a b^{3}\right )} \cos \left (2 \, d x + 2 \, c\right )}{2 \, d} + \frac {{\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {{\left (a^{4} - b^{4}\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.96, size = 320, normalized size = 2.96 \begin {gather*} \frac {3\,\mathrm {atan}\left (\frac {3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (a^2+b^2\right )}^2}{4\,\left (\frac {3\,a^4}{4}+\frac {3\,a^2\,b^2}{2}+\frac {3\,b^4}{4}\right )}\right )\,{\left (a^2+b^2\right )}^2}{4\,d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (-\frac {5\,a^4}{4}+\frac {3\,a^2\,b^2}{2}+\frac {3\,b^4}{4}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {3\,a^4}{4}-\frac {21\,a^2\,b^2}{2}+\frac {11\,b^4}{4}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (\frac {3\,a^4}{4}-\frac {21\,a^2\,b^2}{2}+\frac {11\,b^4}{4}\right )-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (-\frac {5\,a^4}{4}+\frac {3\,a^2\,b^2}{2}+\frac {3\,b^4}{4}\right )+8\,a^3\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+16\,a\,b^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+8\,a^3\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {3\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )\,{\left (a^2+b^2\right )}^2}{4\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________